package com.lm.leetcode;

/**
 * @Auther: Min.Liu
 * @Description:
 * @Date: Created in 11:57 2025/5/9
 */
public class PrintUtils {
    public static <T extends Number> void printStringArray(String[] arr){
        for (int i = 0; i < arr.length; i++) {
            if (i==arr.length-1){
                System.out.println(arr[i]+"]");
            }else if(i==0){
                System.out.print("["+arr[i]+",");
            }else{
                System.out.print(arr[i]+",");
            }
        }
    }

    public static <T extends Number> void printIntArray(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            if (i==arr.length-1){
                System.out.println(arr[i]+"]");
            }else if(i==0){
                System.out.print("["+arr[i]+",");
            }else{
                System.out.print(arr[i]+",");
            }
        }
    }
}
